#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    for (int n = 10000;n < 100000;n++)
    {
        int sum = 0;
        for (int j = 10;j <= 10000;j = j * 10)
        {
            int a = n / j;
            int b = n % j;
            sum = sum + a * b;
        }
        if (sum == n)
            printf("%d ", n);
    }
    return 0;
}